﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Enterprise.Management.Common;

namespace Enterprise.Management.Caches
{
    public class SessionCache
    {
        public const string SESSION_LOGIN = "login-userid";

        public static int UserId
        {
            get { return HttpContext.Current.Session[SESSION_LOGIN].ToSafeInt32(); }
            set { HttpContext.Current.Session[SESSION_LOGIN] = value; }
        }

        public static void ClearAll()
        {
            HttpContext.Current.Session.Clear();
        }
    }
}